<?php

$developers = '';
$projects = '';
$all = '';

if (isset($_REQUEST['type1']))
    $developers = $_REQUEST['type1'];

if (isset($_REQUEST['type2']))
    $projects = $_REQUEST['type2'];

if (isset($_REQUEST['type3']))
    $all = $_REQUEST['type3'];

//echo $developers .'-' . $projects . '-' . $all;

$conn = mysql_connect('localhost', 'root', '');
if (!$conn) {
    die('Could not connect: ' . mysql_error());
} else {
    mysql_select_db("j2eedevelopers", $conn);
    if ($developers == '1') {
        $result = mysql_query("SELECT * FROM j2eedevelopers WHERE Site='j2eedevelopers.net'", $conn);
//print_r($result);
//exit;
        echo "<table border='1' width=35% height=50%>
    <tr>
       <th>Email</th>
        <th>Date</th>
        <th>Type</th>
    </tr>";
        while ($row = mysql_fetch_array($result)) {
            $email = $row['Email'];
            $cdt = $row['cdt'];
            echo "<tr>
	           <td>$email</td>
                   <td>$cdt</td>
                   <td><input type='checkbox' id='typeid' name='checkarrname[]' value='".$email."' onClick='getcheckarrnames()'></td>
	   </tr>";
        }
        echo "</table>";
    }
    if ($projects == '2') {
        $result = mysql_query("SELECT * FROM  `j2eedevelopers` 
                                WHERE Site =  'j2eeprojects.net'
                                LIMIT 0 , 30", $conn);
        //print_r($result);
        //exit;
        echo "<table border='1' width=35% height=50%>
     <tr>
        <th>Email</th>
        <th>Date</th>
        <th>Type</th>
    </tr>";
        while ($row = mysql_fetch_array($result)) {
            $email = $row['Email'];
            $cdt = $row['cdt'];
            echo "<tr>
                           <td>$email</td>
                          
			   <td>$cdt</td>
                           <td><input type='checkbox' id='typeid' name='checkarrname[]' value='".$email."' onClick='getcheckarrnames()'></td>
                 </tr>";
        }
        echo "</table>";
    }
    if ($all == '3') {
        $result = mysql_query("SELECT * FROM j2eedevelopers", $conn);
        //print_r($result);
        //exit;
        echo "<table border='1' width=35% height=50%>
     <tr>
	 <th>Email</th>
       
        <th>Date</th>
        <th>Type</th>
    </tr>";
        while ($row = mysql_fetch_array($result)) {
            $email = $row['Email'];
        
            $cdt = $row['cdt'];
            echo "<tr>
                           <td>$email</td>
                           
                      	   <td>$cdt</td>
                           <td><input type='checkbox' id='typeid' name='checkarrname[]' value='".$email."' onClick='getcheckarrnames()'></td>
                 </tr>";
        }
        echo "</table>";
    }
}

mysql_close($conn);
?> 


